﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace DBSourceToolsLib.CodeParser
{
    public class ResolvedWord : IResolved
    {
        private string m_StringLiteral;
        protected ArrayList m_Children;

        public ResolvedWord(List<ParseObject> lstParseObjects)
        {
            m_Children = new ArrayList();
            foreach (ParseObject oObject in lstParseObjects)
            {
                m_StringLiteral += oObject.Data;
            }
        }

        public bool isLeaf()
        {
            return m_Children.Count == 0;
        }

        public void add(IResolved iResolved)
        {
            m_Children.Add(iResolved);
        }

        public System.Collections.IEnumerator getSubordinates()
        {
            return m_Children.GetEnumerator();
        }

        public virtual IResolved getChild()
        {
            return null;
        }

        ResolvedType IResolved.getResolvedType()
        {
            return ResolvedType.ResolvedLiteral;
        }


        public string DumpToString()
        {
            return m_StringLiteral;
        }
    }
}
